package de.thw.web.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import de.thw.web.dao.AbstractDAO;
import de.thw.web.model.AbstractModel;
import de.thw.web.service.AbstractService;

public abstract class AbstractServiceImpl<T extends AbstractModel> implements
		AbstractService<T> {

	@Transactional
	public void save(T object, AbstractDAO<T> dao) {
		dao.save(object);
	};

	@Transactional
	public T load(String uid, AbstractDAO<T> dao) {
		return dao.load(uid);
	};

	@Transactional
	public List<T> getAll(AbstractDAO<T> dao) {
		return dao.getAll();
	};

};